// 百度地图API功能	
	function showMap(data_info){	
		map = new BMap.Map("allmap");
		map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
		map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
		map.centerAndZoom(new BMap.Point(116.417854,39.921988), 15);
		var sContent=[]
		var sContent1=[]
		for(var j=0;j<tabdata.length;j++){
			for(var i=0;i<tabdata[j]['list'].length;i++){
				var car = tabdata[j]['list'][i]['title'];
				var band = tabdata[j]['list'][i]['band'];
				var adr = tabdata[j]['list'][i]['adr'];
				var time = tabdata[j]['list'][i]['date'];
				var state = tabdata[j]['list'][i]['state'];
				var num = tabdata[j]['list'][i]['num'];
				var des =tabdata[j]['list'][i]['des'];
				var micon = tabdata[j]['list'][i]['icon'];
				var imgs = tabdata[j]['list'][i]['imgs'];
				var myIcon = new BMap.Icon(micon, new BMap.Size(40,50));
				var marker = new BMap.Marker(
					new BMap.Point(tabdata[j]['list'][i]['lng'], tabdata[j]['list'][i]['lat']),
					{icon:myIcon}
				);  // 创建标注
				label = new BMap.Label(num, {
					offset: new BMap.Size(20, 24)
				}); //创建marker点的标记,这里注意下,因为百度地图可以对label样式做编辑,
				label.setStyle({
				 border:"none",
				 background:"none",
				 color:"#fff",
				 fontSize:16,
				 transform:"translateX(-50%)"
				}); //对label 样式隐藏 
				marker.setLabel(label); //把label设置到maker上 
				
				var imgstr=""
				for(var k=0;k<imgs.length;k++){
					imgstr+="<img src='"+imgs[k]+"' onclick=showbigimg('"+imgs[k]+"')>"
				}
				sContent[i] ="<div class='baidu clearfix' style='padding:20px 16px 0;height:158px;width:280px;box-sizing: border-box;background:url(img/bg1.png) no-repeat center;'>" + 
				"<div style='float:left;'>"+
				"<p style='color:#fff;font-size:20px;'>"+car+"</p>" + 
				"<p style='color:#fff;font-size:16px;line-height:28px;'>"+band+"</p>" + 
				"<p style='color:#fff;font-size:16px;line-height:28px;'>所属单位："+adr+"</p>" + 
				"<p style='color:#fff;font-size:16px;line-height:28px;'>出发时间："+time+"</p>" + 
				"</div><div style='float:right;padding-top:35px;'>"+
				"<span style='display: inline-block;width:70px;height:30px;text-align:center;color:#fff;font-size:16px;line-height:30px;border:1px solid #fff;border-radius:4px;'>"+state+"</span>" + 
				"</div></div></div>";
				
				sContent1[i] ="<div style='width:360px;border-radius:10px;' class='maptan'>"+
				"<div class='clearfix' style='position:relative;height:120px;width:100%;padding:10px 16px 0;box-sizing: border-box;background:url(img/bg2.png) no-repeat center;'>" + 
				"<div style='float:left;'>"+
				"<p style='color:#fff;font-size:20px;'>"+car+"</p>" + 
				"<p style='color:#fff;font-size:16px;line-height:24px;'>"+band+"</p>" + 
				"<p style='color:#fff;font-size:16px;line-height:24px;'>所属单位："+adr+"</p>" + 
				"<p style='color:#fff;font-size:16px;line-height:24px;'>出发时间："+time+"</p>" + 
				"</div><div style='float:right;padding-top:35px;'>"+
				"<span style='display: inline-block;width:70px;height:30px;text-align:center;color:#fff;font-size:16px;line-height:30px;border:1px solid #fff;border-radius:4px;'>"+state+"</span>" + 
				"<span onclick='closemap()' style='position:absolute;top:10px;right:16px;'><img src='img/closet.png'></span>"+
				"</div></div>"+
				"<div style='width:100%;height:400px;border-radius:0 0 10px 10px;background:#fff;padding:10px 16px 0;box-sizing: border-box;'>"+
				"<div class='tannav'><a href=''><img src='img/detail.png'>详情</a><a href=''><img src='img/guiji.png'>轨迹</a><a href='javascript:;' onclick='showvideo()'><img src='img/jiankong.png'>监控</a><a href=''><img src='img/genzong.png'>跟踪</a></div>"+
				"<div class='tanp'>报警数字<span>"+num+"</span></div>"+
				"<div class='tanp'>车辆简介</div>"+
				"<div class='tandes'>"+des+"</div>"+
				"<div class='tanp'>车辆图片</div>"+
				"<div class='tanimg'>"+imgstr+"</div>"+
				"</div></div></div>";
				map.addOverlay(marker);               // 将标注添加到地图中
				addMouseoverHandler(sContent[i],marker)
				addClickHandler(sContent1[i],marker);
			}
		}
	}
	
	function openDetail(n1,n2){
		var car = tabdata[n1]['list'][n2]['title'];
		var band = tabdata[n1]['list'][n2]['band'];
		var adr = tabdata[n1]['list'][n2]['adr'];
		var time = tabdata[n1]['list'][n2]['date'];
		var state = tabdata[n1]['list'][n2]['state'];
		var num = tabdata[n1]['list'][n2]['num'];
		var des =tabdata[n1]['list'][n2]['des'];
		var micon = tabdata[n1]['list'][n2]['icon'];
		var imgs = tabdata[n1]['list'][n2]['imgs'];		
		var imgstr=""
		for(var k=0;k<imgs.length;k++){
			imgstr+="<img src='"+imgs[k]+"'>"
		}
		
		var sContent ="<div style='width:360px;border-radius:10px;' class='maptan'>"+
		"<div class='clearfix' style='position:relative;height:120px;width:100%;padding:10px 16px 0;box-sizing: border-box;background:url(img/bg2.png) no-repeat center;'>" + 
		"<div style='float:left;'>"+
		"<p style='color:#fff;font-size:20px;'>"+car+"</p>" + 
		"<p style='color:#fff;font-size:16px;line-height:24px;'>"+band+"</p>" + 
		"<p style='color:#fff;font-size:16px;line-height:24px;'>所属单位："+adr+"</p>" + 
		"<p style='color:#fff;font-size:16px;line-height:24px;'>出发时间："+time+"</p>" + 
		"</div><div style='float:right;padding-top:35px;'>"+
		"<span style='display: inline-block;width:70px;height:30px;text-align:center;color:#fff;font-size:16px;line-height:30px;border:1px solid #fff;border-radius:4px;'>"+state+"</span>" + 
		"<span onclick='closemap()' style='position:absolute;top:10px;right:16px;'><img src='img/closet.png'></span>"+
		"</div></div>"+
		"<div style='width:100%;height:400px;border-radius:0 0 10px 10px;background:#fff;padding:10px 16px 0;box-sizing: border-box;'>"+
		"<div class='tannav'><a href=''><img src='img/detail.png'>详情</a><a href=''><img src='img/guiji.png'>轨迹</a><a href='javascript:;' onclick='showvideo()'><img src='img/jiankong.png'>监控</a><a href=''><img src='img/genzong.png'>跟踪</a></div>"+
		"<div class='tanp'>报警数字<span>"+num+"</span></div>"+
		"<div class='tanp'>车辆简介</div>"+
		"<div class='tandes'>"+des+"</div>"+
		"<div class='tanp'>车辆图片</div>"+
		"<div class='tanimg'>"+imgstr+"</div>"+
		"</div></div></div>";
		openInfo1(sContent,tabdata[n1]['list'][n2]['lng'],tabdata[n1]['list'][n2]['lat'])
	}
	
	function closemap(){
		map.closeInfoWindow(); //开启信息窗口
	}
	function addClickHandler(content,marker){
		marker.addEventListener("click",function(e){
			openInfo(content,e)}
		);
	}
	function addMouseoverHandler(content,marker){
		marker.addEventListener("mouseover",function(e){
			openInfo(content,e)}
		);
	}
	function addMouseoutHandler(content,marker){
		marker.addEventListener("mouseout",function(e){
			closeInfo(content,e)}
		);
	}
	function openInfo(content,e){
		var p = e.target;
		var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
		var infoWindow = new BMap.InfoWindow(content);  // 创建信息窗口对象 
		map.openInfoWindow(infoWindow,point); //开启信息窗口
	}
	function closeInfo(content,e){
		var p = e.target;
		var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
		var infoWindow = new BMap.InfoWindow(content);  // 创建信息窗口对象 
		map.closeInfoWindow(infoWindow,point); //开启信息窗口
	}
	function openInfo1(content,lng,lat){
		var point = new BMap.Point(lng,lat);
		var infoWindow = new BMap.InfoWindow(content);  // 创建信息窗口对象 
		map.openInfoWindow(infoWindow,point); //开启信息窗口
	}
	function showvideo(){
		alert('这是一个视频！')
	}
	function showbigimg(url){
		$('.bigimg').show()
		$('.bigimg').html(`
			<img src='${url}' onclick='chosebigimg()'>
		`)
	}
	function chosebigimg(){
		$('.bigimg').hide()
	}